package com.mm.fam.web.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mm.fam.web.entity.SysLog;
import com.mm.fam.web.mapper.SysLogMapper;
import com.mm.fam.web.service.SysLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
public class SysLogServiceImpl extends ServiceImpl<SysLogMapper, SysLog> implements SysLogService {

    @Autowired
    private SysLogMapper sysLogMapper;

    @Override
    public IPage<SysLog> querySysLogList(Map<String, Object> map, int pageNo, int pageSize) {
        QueryWrapper<SysLog> wrapper = new QueryWrapper<SysLog>();
        wrapper.orderByDesc("gmt_create");

        return sysLogMapper.selectPage(new Page(pageNo, pageSize), wrapper);
    }
}
